home *** CD-ROM | disk | FTP | other *** search
/ The Big Mouth 9 / Big_Mouth_The_09_1996_-_Side_C.d64 / video jigsaw (.txt) < prev   
Commodore BASIC  |  2023-02-26  |  6KB  |  191 lines

  1. 10 if aa=1then90
  2. 20 dimn$(20):poke53280,0:poke53281,0:print"[147][129]"tab(13)" video jigsaw "
  3. 30 gosub1230:aa=1:print"[147]       loading "n$(a)
  4. 40 print" please wait....[144]"
  5. 50 ifleft$(n$(a),1)="d"thenzz=1
  6. 60 ifleft$(n$(a),1)="[129]"thenzz=2
  7. 70 poke49990,zz
  8. 80 load n$(a),8,1
  9. 90 poke55,0:poke56,92:clr:zz=peek(49990):dim n$(200)
  10. 100 fora=828to873:read d:pokea,d:next
  11. 110 fora=49879to49973:read d:pokea,d:next
  12. 120 print"[147]":poke781,8:poke782,5:poke783,0:sys65520
  13. 130 print"choose size of puzzle pieces:"
  14. 140 print"(smaller numbers give harder puzzles)"
  15. 150 poke781,14:poke782,2:poke783,0:sys65520
  16. 160 print"length (from 2 to 12[146])";:input l$
  17. 170 l=val(l$):ifl<2orl>12then150
  18. 180 poke781,18:poke782,2:poke783,0:sys65520
  19. 190 print "width  (from 2 to 20[146])";:input w$
  20. 200 w=val(w$):ifw<2orw>20then180
  21. 210 print"[147]   once puzzle appears you may see"
  22. 220 print"   picture as it should look when"
  23. 230 print"   finished by pressing f1"
  24. 240 print"[158]   plug joystick into port 2"
  25. 250 print"   puzzle construction will blank"
  26. 260 print"   screen for 1 to 2 minutes"
  27. 270 print"  press any key to start construction"
  28. 280 get k$:ifk$=""then print"[145]";:poke646,peek(56325):goto270
  29. 290 poke53265,peek(53265)and239
  30. 300 ifzz=1thengosub1530
  31. 310 ifzz=2thengosub1570:gosub1530:poke53281,peek(34576)
  32. 320 fora=32704to32767:read d:pokea,d:next
  33. 330 v=53248:sid=54272:xx =24+(w*4-4):yy=50+(l*4)-4
  34. 340 pokesid+5,9:pokesid+6,9
  35. 350 max=xx+(int(40/w)-1)*8*w:myx=yy+(int(25/l)-1)*8*l
  36. 360 dim s(1000):dimc(1000)
  37. 370 def fn hi(m)=int(m/256):def fn lo(m)=m-256*fn hi(m)
  38. 380 for n =0 to int (25/l)-1
  39. 390 for n1=0 to int (40/w)-1
  40. 400 b=b+1
  41. 410 s(b)=24576+n1*(w*8)+n*(l*320)
  42. 420 c(b)=55296+n1*(w)+n*(40*l)
  43. 430 a$=a$+chr$(b)
  44. 440 next n1:nextn
  45. 450 d$=a$:b$=a$
  46. 460 fori=1tob:a=i+int((b+1-i)*rnd(0))
  47. 470 d$=mid$(d$,a,1)+left$(d$,a-1)+right$(d$,b-a)
  48. 480 next
  49. 490 z=int(len(d$)/2)*2-2
  50. 500 fori=1to z step2:x1=asc(mid$(d$,i,1)):x2=asc(mid$(d$,i+1,1))
  51. 510 gosub1020:gosub760
  52. 520 poke53280,i:next:d$=b$:b$=a$
  53. 530 b=1
  54. 540 pokev+28,peek(v+28)or1:pokev+39,7:pokev+37,2:pokev+38,5:pokev,x
  55. 550 pokev+1,y:poke24568,255:pokev+21,1
  56. 560 poke53265,peek(53265)and239
  57. 570 poke53265,59:poke53272,120:poke56576,peek(56576)and254
  58. 580 ifzz=2thenpoke53270,216
  59. 590 poke53265,peek(53265)or16
  60. 600 pokesid+24,15
  61. 610 le=l*8:we=w*8
  62. 620 x=xx:y=yy
  63. 630 getk$:ifk$="[133]"thengosub1150
  64. 640 tg=1-tg:pokev+21,tg:j2=peek(56320)
  65. 650 fr=j2and16:jv=15-(j2and15)
  66. 660 if fr=0thengosub950:goto630
  67. 670 ifjv=1 and y>yy theny=y-le:b=b-int(40/w):goto710
  68. 680 ifjv=2 and y<myx theny=y+le:b=b+int(40/w):goto710
  69. 690 ifjv=4 and x>xx thenx=x-we:b=b-1:goto710
  70. 700 ifjv=8 and x<max thenx=x+we:b=b+1
  71. 710 tr=(x>255)
  72. 720 pokev+16,tr*(-1)
  73. 730 pokev,x+(tr*255):pokev+1,y
  74. 740 goto630
  75. 750 gosub1020:ifb$=d$then en=1
  76. 760 forn=0tol-1:for n1=0tow-1
  77. 770 y1=s(x1)+(n1*8)+(n*320):c1=c(x1)+n1+n*40:v1=c1-31744
  78. 780 y2=s(x2)+(n1*8)+(n*320):c2=c(x2)+n1+n*40:v2=c2-31744
  79. 790 yl=fn lo(y1):yh= fn hi(y1)
  80. 800 xl=fn lo(y2):xh= fn hi(y2)
  81. 810 poke165,yl:poke166,yh:poke167,xl:poke168,xh
  82. 820 sys 828
  83. 830 ifzz=2 then poke49160,peek(c1):pokec1,peek(c2):pokec2,peek(49160)
  84. 840 poke49161,peek(v1):pokev1,peek(v2):pokev2,peek(49161)
  85. 850 next:next
  86. 860 ifen=1then1060
  87. 870 return
  88. 880 poke53270,200:poke53265,27:poke53272,21:poke56576,peek(56576)or1:pokev+21,0
  89. 890 poke53280,0:poke53281,0:print"[147][129]   load another picture puzzle and"
  90. 900 print"         play again (y/n)[146] ";
  91. 910 geta$:ifa$=""then910
  92. 920 ifa$="n"then poke55,0:poke56,160:clr:stop
  93. 930 ifa$="y"thenprint:goto30
  94. 940 goto910
  95. 950 fl=fl+1
  96. 960 iffl=2thenx2=b:ifx2=x1then fl=1:return
  97. 970 if fl=2 then fl=0:gosub990:gosub750:return
  98. 980 x1=b:gosub1000:return
  99. 990 hf=110:lf=0:gosub1010:return
  100. 1000 hf=70:lf=0:gosub1010:return
  101. 1010 pokesid+1,hf:pokesid,lf:pokesid+4,17:pokesid+4,16:return
  102. 1020 ifx1>x2thenx3=x1:x1=x2:x2=x3
  103. 1030 x1$=mid$(b$,x1,1):x2$=mid$(b$,x2,1)
  104. 1040 b$=left$(b$,x1-1)+x2$+mid$(b$,x1+1,x2-x1-1)+x1$+right$(b$,len(b$)-x2)
  105. 1050 return
  106. 1060 for r=0to2
  107. 1070 pokesid+5,85:pokesid+6,85:pokesid+12,85:pokesid+13,85
  108. 1080 pokesid+4,33:pokesid+11,17
  109. 1090 forn=0to5:forx=0to3:v(x)=peek(850+(n*4)+x):next
  110. 1100 pokesid+1,v(0):pokesid,v(1):pokesid+8,v(2):pokesid+7,v(3):poke53280,v(2)
  111. 1110 ifh1=50then for t=1to200:next
  112. 1120 fort=1to125:next:next
  113. 1130 pokesid+4,32:pokesid+11,16:forw=1to500:next:next
  114. 1140 goto880
  115. 1150 ifzz=2thengosub1620
  116. 1160 poke53272,8:poke56576,(peek(56576)and252)or1
  117. 1170 pokev+21,0
  118. 1180 getk$:ifk$<>"[133]"then1180
  119. 1190 ifzz=2thengosub1620
  120. 1200 poke53272,120:poke56576,(peek(56576)and252)or2
  121. 1210 pokev+21,1
  122. 1220 return
  123. 1230 print" please insert disk containing doodle[146]":n=1
  124. 1240 print tab(8);"or koala[146] picture files"
  125. 1250 print"       press any key when ready"
  126. 1260 getk$:if k$=""then1260
  127. 1270 print"[147]"tab(12);" picture files "
  128. 1280 open1,8,0,"$"
  129. 1290 get#1,b$:ifst<>0then1400
  130. 1300 ifn>19then1400
  131. 1310 ifb$<>chr$(34)then1290
  132. 1320 n$=""
  133. 1330 get#1,b$:ifb$<>chr$(34)then n$=n$+b$:goto1330
  134. 1340 get#1,b$:ifb$=chr$(32)then1340
  135. 1350 ifleft$(n$,1)=" "then n=n-1:goto1380
  136. 1360 ifleft$(n$,2)<>"dd"andleft$(n$,1)<>"[129]" thenn=n-1:goto1380
  137. 1370 n$(n)=n$:printtab(12)n$(n)
  138. 1380 get#1,b$:ifb$<>""then1380
  139. 1390 if st=0then n=n+1:goto1290
  140. 1400 close1
  141. 1410 ifn=1thenprint"      no pictures on this disk":fori=1to2000:next:goto1230
  142. 1420 print"  (use cursor up/down to highlight)
  143. 1430 [153]"    press return to load picture
  144. 1440 a=1:c1=0:c=125:gosub1510
  145. 1450 k=peek(197):sh=peek(653):ifk<>7andk<>1then1450
  146. 1460 ifk=7andsh=0anda<(n-1)thenc1=1:gosub1500
  147. 1470 ifk=7and sh=1anda>1thenc1=-1:gosub1500
  148. 1480 ifk=1thenreturn
  149. 1490 goto1450
  150. 1500 fori=0to24:poke55296+i+(a)*40+c,8:next
  151. 1510 a=a+c1:fori=0to24:poke55296+i+(a)*40+c,1:next
  152. 1520 return
  153. 1530 poke49872,0:poke49873,92:poke49874,0:poke49875,96:poke49876,0
  154. 1540 poke49877,128:poke49878,0:sys49879
  155. 1550 poke49872,0:poke49873,96:poke49874,0:poke49875,128:poke49876,0
  156. 1560 poke49877,160:poke49878,0:sys49879:return
  157. 1570 poke49872,64:poke49873,127:poke49874,39:poke49875,131:poke49876,0
  158. 1580 poke49877,92:poke49878,0:sys49879
  159. 1590 poke49872,40:poke49873,131:poke49874,15:poke49875,135:poke49876,0
  160. 1600 poke49877,216:poke49878,0:sys49879
  161. 1610 poke49877,196:poke49878,0:sys49879:return
  162. 1620 poke49872,0:poke49873,216:poke49874,0:poke49875,220:poke49876,0
  163. 1630 poke49877,196:poke49878,1:sys49879:return
  164. 1640 data 160,0,177,165,153,0,192,177
  165. 1650 data 167,145,165,185,0,192,145,167
  166. 1660 data 200,192,8,208,237,96,25,30
  167. 1670 data 18,209,33,135,25,30,42,62
  168. 1680 data 31,165,50,60,37,162,42,62
  169. 1690 data 31,165,50,60,37,162
  170. 1700 data 173,210,194,205,208,194,173
  171. 1710 data 211,194,237,209,194,144,80,173
  172. 1720 data 208,194,133,251,173,209,194
  173. 1730 data 133,252,173,212,194,133,253
  174. 1740 data 173,213,194,133,254,173,210
  175. 1750 data 194,133,247,173,211,194,133
  176. 1760 data 248,173,214,194,133,249,160,0
  177. 1770 data 177,251,166,249,240,8,133,250
  178. 1780 data 177,253,145,251,165,250,145
  179. 1790 data 253,230,251,208,2,230,252,230
  180. 1800 data 253,208,2,230,254,165,252,197
  181. 1810 data 248,208,222,165,247,197,251,48
  182. 1820 data 3,76,10,195,96
  183. 1830 data 170,192,0,187,0,0,169,0
  184. 1840 data 0,183,64,0,193,144,0,0
  185. 1850 data 116,0,0,25,0,0,7,64
  186. 1860 data 0,1,144,0,0,116,0,0
  187. 1870 data 25,0,0,7,0,0,0,0
  188. 1880 data 0,0,0,0,0,0,0,0
  189. 1890 data 0,0,0,0,0,0,0,0
  190. 1900 data 0,0,0,0,0,0,0,197
  191.